<template>
    <div id="discuss">
        <div v-for="x in talkList">
            <div v-if="x.type==2">
                <div class="allData">
                    <div class="Data">
                        <img :src="x.sellTalk.logo">
                        <ul class="user">
                            <li class="uName">{{x.sellTalk.name}}</li>
                            <li class="uTime">{{x.sellTalk.time}}</li>
                        </ul>
                    </div>
                    <span></span>
                    <div class="textP">
                        <p v-for="y in x.sellTalk.msg">{{y}}</p>
                    </div>
                </div>
                <div class="allData">
                    <div class="Data">
                        <img :src="x.buyerTalk.logo">
                        <ul class="user">
                            <li class="uName">{{x.buyerTalk.name}}</li>
                            <li class="uTime">{{x.buyerTalk.time}}</li>
                        </ul>
                    </div>
                    <span></span>
                    <div class="allT">
                        <h1 v-for="z in x.buyerTalk.msg">{{z}}</h1>
                    </div>
                </div>
            </div>
            <div v-else>
                <div class="allData">
                    <div class="Data">
                        <img :src="x.buyerTalk.logo">
                        <ul class="user">
                            <li class="uName">{{x.buyerTalk.name}}</li>
                            <li class="uTime">{{x.buyerTalk.time}}</li>
                        </ul>
                    </div>
                    <span></span>
                    <div class="allT">
                        <h1 v-for="z in x.buyerTalk.msg">{{z}}</h1>
                    </div>
                </div>
                <div class="allData">
                    <div class="Data">
                        <img :src="x.sellTalk.logo">
                        <ul class="user">
                            <li class="uName">{{x.sellTalk.name}}</li>
                            <li class="uTime">{{x.sellTalk.time}}</li>
                        </ul>
                    </div>
                    <span></span>
                    <div class="textP">
                        <p v-for="y in x.sellTalk.msg">{{y}}</p>
                    </div>
                </div>
            </div>
        </div>
    </div>
</template>

<script>
    import config from "../config/config.js";
    export default{
        data(){
            return{
                talkList:{}
            }
        },
        methods:{
            ShowRefundTalk(orderid){
                var value=JSON.stringify({"orderid":orderid,"token":localStorage.getItem('token')}),
                    key=demo(value);
                axios.post('/Home/refund/ShowRefundTalk',{
                    value:value,
                    key:key
                },config)
                    .then(function(response) {
                        if(response.data.code==200){
                            this.talkList=response.data.data;
                        }
                    }.bind(this))
                    .catch(function (error) {
                        console.log(error);
                    });
            }
        },
        activated(){
            var id=this.$route.params.orderid;
            this.ShowRefundTalk(id)
        }
    }
</script>

<style>
</style>